

<div id="main">
  <h2>My Offers</h2>  
  <% if logged_in? %>
    <% #  Your ID is  @current_user.id   %>
  <% else %>
    //
  <% end %>
        
  <h3>Offers for My books</h3>
  <ul>
    <% for to_offer in @offers_to_me %>
      <li>
        <%= link_to h(to_offer.offer_book_title), :controller => "book", :action => "show", :id => to_offer.offer_book_id %> 
        Offered for your Book 
        <%= link_to h(to_offer.my_book_title), :controller => "book", :action => "show", :id => to_offer.my_book_id %> 
      </li>
    <%  end %>
  </ul>
  
  <h3>My Offers for Other peoples books</h3>
  <ul>
    <% for from_offer in @offers_from_me %>
      <li>
        You offered 
        <%= link_to h(from_offer.my_book_title), :controller => "book", :action => "show", :id => from_offer.my_book_id %> 
        For the book       
        <%= link_to h(from_offer.offer_book_title), :controller => "book", :action => "show", :id => from_offer.offer_book_id %> 
      </li>
    <%  end %>
  </ul>
</div>

<div id="sub">
  <div>
    <h3>User Menu</h3>
    <ul>
      <li><%= link_to("My Books", :controller => "user", :action => "mybooks")%></li>
      <li><%= link_to("Add a Book", :controller => "book", :action => "new")%></li>
      <li><%= link_to("Match Maker", :controller => "user", :action => "mymatch")%></li>
      <li><%= link_to("My Offers", :controller => "user", :action => "offers")%></li>
    </ul>
  </div>
  
</div>